Optimal. Leaf size=43 \[ \frac {(a+b) \log (1-\cos (c+d x))}{2 d}+\frac {(a-b) \log (1+\cos (c+d x))}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.04, antiderivative size = 43, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 4, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.235, Rules used = {3968, 2747,
647, 31} \begin {gather*} \frac {(a+b) \log (1-\cos (c+d x))}{2 d}+\frac {(a-b) \log (\cos (c+d x)+1)}{2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 31
Rule 647
Rule 2747
Rule 3968
Rubi steps
\begin {align*} \int \cot (c+d x) (a+b \sec (c+d x)) \, dx &=\int (b+a \cos (c+d x)) \csc (c+d x) \, dx\\ &=-\frac {a \text {Subst}\left (\int \frac {b+x}{a^2-x^2} \, dx,x,a \cos (c+d x)\right )}{d}\\ &=-\frac {(a-b) \text {Subst}\left (\int \frac {1}{-a-x} \, dx,x,a \cos (c+d x)\right )}{2 d}-\frac {(a+b) \text {Subst}\left (\int \frac {1}{a-x} \, dx,x,a \cos (c+d x)\right )}{2 d}\\ &=\frac {(a+b) \log (1-\cos (c+d x))}{2 d}+\frac {(a-b) \log (1+\cos (c+d x))}{2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.04, size = 60, normalized size = 1.40 \begin {gather*} -\frac {b \log \left (\cos \left (\frac {c}{2}+\frac {d x}{2}\right )\right )}{d}+\frac {b \log \left (\sin \left (\frac {c}{2}+\frac {d x}{2}\right )\right )}{d}+\frac {a (\log (\cos (c+d x))+\log (\tan (c+d x)))}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.08, size = 33, normalized size = 0.77
method | result | size |
derivativedivides | \(\frac {b \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )+a \ln \left (\sin \left (d x +c \right )\right )}{d}\) | \(33\) |
default | \(\frac {b \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )+a \ln \left (\sin \left (d x +c \right )\right )}{d}\) | \(33\) |
risch | \(-i a x -\frac {2 i a c}{d}+\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right ) b}{d}+\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right ) b}{d}\) | \(84\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.30, size = 34, normalized size = 0.79 \begin {gather*} \frac {{\left (a - b\right )} \log \left (\cos \left (d x + c\right ) + 1\right ) + {\left (a + b\right )} \log \left (\cos \left (d x + c\right ) - 1\right )}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.30, size = 38, normalized size = 0.88 \begin {gather*} \frac {{\left (a - b\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + {\left (a + b\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right )}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \sec {\left (c + d x \right )}\right ) \cot {\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.44, size = 61, normalized size = 1.42 \begin {gather*} \frac {{\left (a + b\right )} \log \left (\frac {{\left | -\cos \left (d x + c\right ) + 1 \right |}}{{\left | \cos \left (d x + c\right ) + 1 \right |}}\right ) - 2 \, a \log \left ({\left | -\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} + 1 \right |}\right )}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.31, size = 51, normalized size = 1.19 \begin {gather*} \frac {a\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}-\frac {a\,\ln \left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}{d}+\frac {b\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________